Skip to content

Conversation

@SuperMeister808
Copy link

I refactored the move() method in main.py into a dedicated Move() class in a new file move.py. This organization helps newcomers to understand that not every part in main.py is a part of the bot logic. It separates the handler from the bot logic clearly.
The class uses a structured data format for moves: {str move: {is_safe: bool}} e.g. {"left": {is_safe: False}}
This structure is easily extendable for example by adding a priority key for more advanced move logic.
At least I added a test package which ensures that the class works as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant